import React from 'react'
import  { useEffect } from 'react';
import useDrivePicker from 'react-google-drive-picker'
function App() {

    const [openPicker,data, authResponse] = useDrivePicker();
    // const customViewsArray = [new google.picker.DocsView()]; // custom view
    const handleOpenPicker = () => {
        openPicker({
            clientId: "241368681569-rf14cef33ejibp3p0o9k0fl1p15nl7ak.apps.googleusercontent.com",
            developerKey: "AIzaSyBRkXh8QI0-ZFPcfoK_MrB62Kl4wqfu_Lc",
            viewId: "DOCS",
            token: "ya29.a0AfB_byADkyqiLCFAmcVPiD_9IT7K-AemY4qfoNLTNV9rMbXFc--nJ_ztZyTO4ciKNlH31MjtzGzpJnOJFwauFm4A7q7qx0SgsKSGC92WfvkgWSIbg2C7I_T8Jmk4rVd3854oXWHUfb_ZbAb-zapMzPzwhT-5f6bFzgVGsAaCgYKAdcSARISFQHsvYlsqMd84JCNGo8pXJC6DthiMA0173", // pass oauth token in case you already have one
            showUploadView: true,
            showUploadFolders: true,
            supportDrives: true,
            multiselect: true,
            // customViews: customViewsArray, // custom view
            callbackFunction: (data) => {
                if (data.action === 'cancel') {
                    console.log('User clicked cancel/close button')
                }
                console.log(data)
            },
        })
    }


    return (
        <>
            <button onClick={()=>{handleOpenPicker()}}> upload picker</button>
        </>
    )
}

export default App;